﻿@{
    ViewBag.Title = "BatchAddCs";
}
@section scripts
{
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <link href="~/Scripts/miniui/themes/default/medium-mode.css" rel="stylesheet" type="text/css" />       
}

<div title="选择" style="width:100%;height:365px;">
    <div class="mini-toolbar" style="height:30px;"> 
        <table style="width:50%;float:left;">
            <tr>
                <td style="width:100%;">
                    <a class="mini-button" name="addcolor" iconCls="icon-new" onclick="onOk" plain="true">确定</a>
                    <span class="separator"></span>
                    <a class="mini-button" iconCls="icon-close" onclick="CloseWindow" plain="true">关闭</a>
                </td>
            </tr>
        </table>                
    </div>
    <div style="width:50%;height:400px;float:left;">
        <div class="mini-fit">
            <div id="colorgrid" class="mini-datagrid" style="width:100%;height:100%;" pageSize="100"
                    borderStyle="border:1;" url="GetGoodsColor" showPager="false" idField="FItemID"
                    allowCellSelect="true" allowCellEdit="true"showColumnsMenu="true"fitColumns="false"  
                    sortMode="client" multiSelect="true">
                <div property="columns">
                    <div type="checkcolumn" width="40">选择</div>
                    <div header="FItemID" field="FItemID" width="0" visible="false"></div>
                    <div field="FNumber" name="FNumber" width="100" headeralign="center" allowsort="true">编码</div>
                    <div field="FName" name="FName" width="190" headeralign="center" allowsort="true">颜色</div>
                </div>
            </div>
        </div>
    </div>
    <div style="width:50%;height:400px;float:right;">
        <div class="mini-fit">
            <div id="sizegrid" class="mini-datagrid" style="width:100%;height:100%;" pageSize="100"
                    borderStyle="border:1;" url="GetGoodsSize" showPager="false" idField="FItemID"
                    allowCellSelect="true" allowCellEdit="true"showColumnsMenu="true"fitColumns="false"  
                    sortMode="client" multiSelect="true">
                <div property="columns">
                    <div type="checkcolumn" width="40">选择</div>
                    <div header="FItemID" field="FItemID" width="0" visible="false"></div>
                    <div field="FNumber" name="FNumber" width="100" headeralign="center" allowsort="true">编码</div>
                    <div field="FName" name="FName" width="190" headeralign="center" allowsort="true">尺码</div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    mini.parse();
    var colorgrid = mini.get("colorgrid");
    var sizegrid = mini.get("sizegrid");

    $(function () {
        LoadListcolor();
        LoadListsize();
    });

    function LoadListcolor() {
        var sSystemAppID = parent.window.getSystemAppID();
        var json = "[{";
        json = json + "'mSystemAppID':" + "'" + sSystemAppID + "'";
        json = json + "}]";
        colorgrid.load({ mydata: json });
    }
    function LoadListsize() {
        var sSystemAppID = parent.window.getSystemAppID();
        var json = "[{";
        json = json + "'mSystemAppID':" + "'" + sSystemAppID + "'";
        json = json + "}]";
        sizegrid.load({ mydata: json });
    }

    function onOk(e) {
        var dataRow = {};
        dataRow.color = colorgrid.getSelecteds();
        dataRow.size = sizegrid.getSelecteds();
        CloseWindow(dataRow);
    }
</script>